package com.jimmie.myshop.myshopproduct.mapper;

import com.jimmie.myshop.myshopproduct.model.Brand;
import org.apache.ibatis.annotations.*;


@Mapper
public interface BrandMapper {
	
	@Insert("INSERT INTO product_brand(name,des) VALUES(#{name},#{des})")
	@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
	public void add(Brand brand);
	
	@Update("UPDATE product_brand SET name=#{name},des=#{des} WHERE id=#{id}")
	public void update(Brand brand);
	
	@Delete("DELETE FROM product_brand WHERE id=#{id}")
	public void delete(Long id);
	
	@Select("SELECT * FROM product_brand WHERE id=#{id}")
	public Brand findById(Long id);
	
}
